package cn.ssm.test.controller;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import cn.ssm.test.model.RetObj;
import cn.ssm.test.model.ScheduleJobLogEntity;
import cn.ssm.test.service.ScheduleJobLogService;

/**
 * 定时任务日志
 * 
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2016年12月1日 下午10:39:52
 */
@Controller
@RequestMapping("/scheduleLog")
public class ScheduleJobLogController {
	@Autowired
	private ScheduleJobLogService scheduleJobLogService;
	
	/**
	 * 定时任务日志列表
	 */
	@RequestMapping("/list")
	public RetObj list(@RequestParam Map<String, Object> params){
		//查询列表数据
		/*List<ScheduleJobLogEntity> jobList = scheduleJobLogService.queryList(query);
		int total = scheduleJobLogService.queryTotal(query);
		
		PageUtils pageUtil = new PageUtils(jobList, total, query.getLimit(), query.getPage());
		
		return R.ok().put("page", pageUtil);*/
		
		return null;
	}
	
	/**
	 * 定时任务日志信息
	 */
	@RequestMapping("/info/{jobId}")
	public String info(@PathVariable("jobId") Long jobId,HttpServletRequest request){
		List<ScheduleJobLogEntity> logList = scheduleJobLogService.queryObject(jobId);
		request.setAttribute("logList", logList);
		return "taskLog";
	}
	
	
	
	
	
	
	
}
